package com.boco.modules.fdoc.service.impl;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.boco.modules.fdoc.dao.OutpatientSourceDao;
import com.boco.modules.fdoc.service.OutpatientSourceService;
import com.boco.modules.fdoc.vo.BizOutpatientSourceVo;

/**
 * Description
 * @author lzz
 * @date 2017年7月26日 上午11:40:40
 */
@Service
public class OutpatientSourceServiceImpl implements OutpatientSourceService{

	@Resource
	OutpatientSourceDao sourceDao;
	
	@Override
	public List<BizOutpatientSourceVo> getSourceList(BizOutpatientSourceVo querybvo) {
		List<BizOutpatientSourceVo> list= sourceDao.getSourceList(querybvo);
		for(BizOutpatientSourceVo bvo:list){
			String datestr=(new SimpleDateFormat("yyyy-MM-dd")).format(bvo.getClinicDate());
			bvo.setClinicDateStr(datestr);
		}
		return list;
	}

	@Override
	public Integer getSourceCount(BizOutpatientSourceVo querybvo) {
		return sourceDao.getSourceCount(querybvo);
	}

	@Override
	public BizOutpatientSourceVo getSourceById(Integer id) {
		BizOutpatientSourceVo bVo=sourceDao.getSourceById(id);
		String datestr=(new SimpleDateFormat("yyyy-MM-dd")).format(bVo.getClinicDate());
		bVo.setClinicDateStr(datestr);
		return bVo;
	}

	@Override
	public Integer updateSource(BizOutpatientSourceVo bVo) {
		return sourceDao.updateSource(bVo);
	}

	@Override
	public Integer addSource(BizOutpatientSourceVo saveBvo) {
		return sourceDao.saveSource(saveBvo);
	}

	@Override
	public Integer getSourceHased(BizOutpatientSourceVo searchVo) {
		return sourceDao.getSourceHased(searchVo);
	}

}
